// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from "vue";
import Mint from "mint-ui";

import App from "./App";
import router from "./router";
import "amfe-flexible";
import "mint-ui/lib/style.css";

import "loaders.css/loaders.min.css";
import footer from "./components/footer";
import NProgress from "nprogress"; // progress bar
import "nprogress/nprogress.css"; // progress bar style
import "./assets/css/main.scss";
import datalist from "./components/datalist";
import xdimg from './components/xdimg';

NProgress.configure({ showSpinner: false }); // NProgress Configuration

import VuePhotoSwipe from "./components/Photoswipe/index";

Vue.use(VuePhotoSwipe);

import * as filters from './filters'

// Vue.config.productionTip = false

Object.keys(filters).forEach(key => {
  Vue.filter(key, filters[key])
})

Vue.use(Mint);
Vue.component("xd-footer", footer);
Vue.component("xd-img", xdimg);
Vue.component('xd-datalist',datalist);

router.beforeEach((to, from, next) => {
  NProgress.start(); // start progress bar
  if (to.meta.title) {
    document.title = to.meta.title;
  }
  next();
});
router.afterEach(() => {
  NProgress.done(); // finish progress bar
});

import FastClick from "fastclick";

FastClick.attach(document.body);
/* eslint-disable no-new */
import baseMixin from "./mixins/baseMixin";
Vue.mixin(baseMixin);
new Vue({
  el: "#app",
  router,
  components: { App },
  template: "<App/>"
});
